import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/sys/login',
    method: 'post',
    data
  })
}

export function getInfo() {
  return request({
    url: '/sys/profile',
    method: 'POST'
  })
}

export function getDetialById(id) {
  return request({
    url: `/sys/user/${id}`,
    method: 'get'
  })
}

// 给角色分配权限
export function assignRole(data) {
  return request({
    url: '/sys/user/assignRoles',
    method: 'put',
    data
  })
}
